<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header1', 'admin');
include $this->admin_tpl('left1', 'admin');

?>
<link rel="stylesheet" type="text/css" href="<?php echo JS_PATH?>calendar/jscal2.css"/>
<link rel="stylesheet" type="text/css" href="<?php echo JS_PATH?>calendar/border-radius.css"/>
<link rel="stylesheet" type="text/css" href="<?php echo JS_PATH?>calendar/win2k.css"/>
<script type="text/javascript" src="<?php echo JS_PATH?>calendar/calendar.js"></script>
<script type="text/javascript" src="<?php echo JS_PATH?>calendar/lang/en.js"></script>
<link href="<?php echo CSS_PATH?>dialog.css" rel="stylesheet" type="text/css" />
<link href="<?php echo CSS_PATH?>dist/magic-input.min.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="<?php echo JS_PATH?>dialog.js"></script>
<div class="pad-lr-10">
<form name="myform"  action="" method="get">
<input type="hidden" value="admin" name="m">
<input type="hidden" value="boneDatabase" name="c">
<input type="hidden" value="hospitalinfoList" name="a">
<input type="hidden" value="1" name="search">
<input type="hidden" value="<?php echo $pc_hash;?>" name="pc_hash">
<div class="pull-left">
	  <?php echo runhook('admin_top_left_menu')?>
      <?php echo L('current_position')?><span id="current_pos">医院信息 </span>
</div>
<?php //if($_SESSION['roleid']=='1'){?>
<table width="100%" cellspacing="0" class="search-form">
    <tbody>
	<tr>
		<td>
		<div class="explain-col ">
			&nbsp;&nbsp;&nbsp;<?php echo L('每页显示');?>：<input   name="perpage" type="text" value="<?php if(isset($perpage)) echo $perpage;?>" class="input-text" size="3" />

			<input type="submit" name="search" class="button" value="<?php echo L('search');?>" />
		<input  type="button" value="添加" onclick="addnew()" />
		</div>
		</td>
		</tr>
    </tbody>
</table>
<?php //}?>
<div class="table-list">
    <table width="100%" cellspacing="0" id="i_table_list_1">
        <thead>
            <tr style="background-color: #c7ddff;height: 44px">
            	<th  align="left"><?php echo L('选择');?><!-- <input type="checkbox" onclick="clickCKB(this);"/> --></th>
<!--            	<th  align="left">id</th>-->
				<th  align="left">医院名</th>
				<th  align="left">医院号</th>
				<th  align="left">信息状态</th>
				<th  align="left"><?php echo L('operation');?></th>
            </tr>
        </thead>
    <tbody>
	<?php if(is_array($data)){foreach($data as $v){?>
    <tr  style="height: 35px">

        <td align="left"><input  type="checkbox" class="mgr mgr-primary mgc-circle" name="id" value="<?php echo $v['id']?>"/></td>
<!--        <td align="left">--><?php //echo $v['id']?><!--</td>-->
        <td align="left"><?php echo $v['hospitalname']?></td>
        <td align="left"><?php echo $v['hospitalnum']?></td>
        <?php if ($v['status']=='0') {?>
            <td align="left">未删除</td>
        <?php }?>
        <?php if ($v['status']=='1') {?>
            <td align="left">删除</td>
        <?php }?>
        <td align="left">
            <div class="fabu">
                <a class="glyphicon glyphicon-edit smallpic" data-toggle="tooltip" data-placement="left" title="编辑" href="javascript:edit('<?php echo $v['id']?>')"></a>
                <a class="glyphicon glyphicon-trash smallpic " data-toggle="tooltip" data-placement="left" title="删除" href="javascript:dodelete('<?php echo $v['id']?>')"onclick="return confirm('确定删除么？')"></a>
            </div>
        </td>
    </tr>
<?php }} ?>
	<tr style="background-color: #c7ddff;height: 44px">
	<td align="left"><input  class="mgr mgr-primary mgc-circle" type="checkbox" name="selectedInverse" onClick="Reverse(this);" id="un_select_all"  /><?php echo L('check_all');?></td>
        <script type="text/javascript">
            function Reverse(obj){
                len = document.myform.elements.length;
                var i;
                for (i=0; i<len; i++) {
                    if (document.myform.elements[i].name=='id') {
                        document.myform.elements[i].click();
                    }
                }
                if(obj.checked) {

                    document.myform.selectAll.checked = false ;
                }
            }
        </script>
	<td colspan="20">
	<?php echo L('selected item');?>
	<select id="i_select_ckall">
		<option value="2"><?php echo L('del');?></option>
	</select>
	<input type="button" onclick="doCKALL();"  value="<?php echo L('determine');?>" />
	</td>
	</tr>
</tbody>
  	</table>
  		
	</div>
    <div id="pages"><?php echo $multipage;?> </div>
</form>

</div>

<div class="fav-nav">
				
					<!--<div id="paneladd"></div>-->
					<input type="hidden" id="menuid" value="">
					<input type="hidden" id="bigid" value="" />
                    <div id="help" class="fav-help"></div>
	
</div>
</div>
</body>
</html>


<script type="text/javascript">
	$(function(){
		    $('#addpatients').click(function(){
             $('.page-content').addClass('page-sidebar-closed');

        });
	})
</script>
<script type="text/javascript">

function doCKALL(){
	var doitem = $('#i_select_ckall').val() ;
	 var arr =[];    
     var str='';
     $("input[name=id]:checked").each(function(){    
         arr.push({vid:$(this).val()});
         str += $(this).val()+",";
     });
     if (str.length > 0) {
 	    //得到选中的checkbox值序列
    	 str = str.substring(0,str.length - 1);
 	} 
    if(str!=''){
    	//event.returnValue = confirm("删除是不可恢复的，你确认要删除吗？");
  
    	if(doitem == '2'){  
    		if(window.confirm('确定删除吗')){//删除
			location.href ='?m=admin&c=boneDatabase&a=hospitalinfo_deleteAll&id='+str+'&pc_hash='+pc_hash
	    	+'&goback='+BASE64.encode(location.search);
			}
    	}			
    }else{
    	alert('你还没有选择任何内容！');
     }
}

function addnew(){
	location.href ='?m=admin&c=boneDatabase&a=hospitalinfo_add&id=&pc_hash='+pc_hash
	+'&goback='+BASE64.encode(location.search);
}

function dodelete(id) {
    location.href ='?m=admin&c=boneDatabase&a=hospitalinfo_delete&id='+id+'&pc_hash='+pc_hash
	+'&goback='+BASE64.encode(location.search);
}
function edit(id){
	location.href ='?m=admin&c=boneDatabase&a=hospitalinfo_edit&id='+id+'&pc_hash='+pc_hash+'&goback='+BASE64.encode(location.search);
}
function view(id){
	location.href ='?m=admin&c=boneDatabase&a=hospitalinfo_view&id='+id+'&pc_hash='+pc_hash+'&goback='+BASE64.encode(location.search);
}
</script>

<script type="text/javascript" src="statics/js/base64.js"></script>
<script type="text/javascript">
</script>
<?php
defined('IN_ADMIN') or exit('No permission resources.');

include $this->admin_tpl('left1', 'admin');

?>
